package fi.aalto.cse.T110_5150.P2PClient;

import java.util.Hashtable;

public class SharedResources extends Hashtable<ByteArray, Resource[]> {

	private static final long serialVersionUID = -2846709497011763501L;
	private static short nextResourceId = 1;

	public SharedResources() {
	}

	public void setValues(ByteArray keyArray, IntegerArray valueInteger) {

		Resource[] resources = new Resource[valueInteger.size()];

		for (int i = 0; i < valueInteger.size(); ++i) {
			resources[i] = new Resource(nextResourceId++, valueInteger.get(i));
		}

		put(keyArray, resources);
	}	
}
